<section class="panel new-events clearfix">
  <header class="panel-header with-hr clearfix">
    <h1 class="panel-title">更新活动</h1>
  </header>
  <div class="events-wrap clearfix">
    <%= form_for @event, url: event_path(@event), method: :put do |f| %>
      <div class="file-upload">
        <div class="cover">
          <%= image_tag @event.cover.url %>
        </div>
        <div class="cover-upload">
          <div class="upload-cover">
            <span>上传封面</span>
            <span class="upload icon"></span>
            <%= f.file_field :cover, id: "events_cover", accept: "image/*" %>
          </div>
        </div>
      </div>
      <div class="file-info form-default">
        <div class="form-group title clearfix">
          <label>活动标题</label>
          <%= f.text_field :header %>
        </div>
        <div class="form-group time clearfix">
          <label>活动时间</label>
          <%= f.text_field :start_at, value: @event.start_time, id: "start_time" %>
          <span>~</span>
          <%= f.text_field :end_at, value: @event.end_time, id: "end_time" %>
        </div>
        <div class="form-group clearfix">
          <label>活动地点</label>
          <%= f.text_field :venue %>
        </div>
        <div class="form-group introduction clearfix">
          <label>活动介绍</label>
          <%= f.text_area :content, id: "wangEditorArea" %>
        </div>
        <div class="btn-operate clearfix">
          <button type="submit" class="btn-default btn-warning">更新活动</button>
          <%= link_to "删除活动", event_path(@event), method: :delete, data: { confirm: '您确定要删除该活动？' }, class: "btn-default btn-delete" %>
        </div>
      </div>
    <% end %>
  </div>
</section>
